<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\consts\Consts;
use common\business\EhrHelper;

/* @var $this yii\web\View */
/* @var $model common\models\qywx\QywxUser */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Qywx Users'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="qywx-user-view">
    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
        <?= Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Return To List'), ['index'], ['class' => 'btn btn-primary']) ?>
    </p>

    <div class="box box-widget widget-user-2">
        <!-- Add the bg color to the header using any of the bg-* classes -->
        <div class="widget-user-header bg-yellow">
            <div class="widget-user-image">
                <img class="img-circle" src="<?= $model->avatar ?>" alt="<?= Yii::t('app', 'U Portrait')?>">
            </div>
            <!-- /.widget-user-image -->
            <h3 class="widget-user-username"><?= $model->name ?></h3>
            <h5 class="widget-user-desc"><?= $model->position ?></h5>
            <h5 class="widget-user-desc">
                <div class="icon">
                    <?php
                    $iconClass = 'fa fa-user-secret';
                    switch ($model->gender) {
                        case Consts::GENDER_MALE:
                            $iconClass = 'fa fa-male';
                            break;
                        case Consts::GENDER_FEMALE:
                            $iconClass = 'fa fa-female';
                            break;
                        default:
                            $iconClass = 'fa fa-user-secret';
                    }
                    ?>
                    <i class="<?= $iconClass ?>"></i>
                </div>
            </h5>
        </div>
        <div class="box-footer no-padding">
            <ul class="nav nav-stacked">
<!--                <li><a href="#">--><?//= Yii::t('app', 'Fans') ?><!--<span class="pull-right badge bg-red">99</span></a></li>-->
                <li><a href="#"><?= Yii::t('app', 'Employee Number') ?>
                        <span class="pull-right"><?= $model->number ?></span>
                    </a>
                </li>
                <li><a href="<?= "tel:".$model->mobile ?>"><?= Yii::t('app', 'Mobile') ?>
                        <span class="pull-right"><?= $model->mobile ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Gender') ?>
                        <span class="pull-right"><?= EhrHelper::getGenderByIntValue($model->gender) ?></span>
                    </a>
                </li>
                <li><a href="<?= "mailto:".$model->email ?>"><?= Yii::t('app', 'Email') ?>
                        <span class="pull-right"><?= $model->email ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Is Leader') ?>
                        <span class="pull-right"><?= EhrHelper::getQywxUserIsLeaderByIntValue($model->is_leader) ?></span>
                    </a>
                </li>
                <li><a href="<?= "tel:".$model->telephone ?>"><?= Yii::t('app', 'Telephone') ?>
                        <span class="pull-right"><?= $model->telephone ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'English Name') ?>
                        <span class="pull-right"><?= $model->english_name ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Department') ?>
                        <span class="pull-right"><?= $model->department ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Department Name') ?>
                        <span class="pull-right"><?= $model->department_name ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Order') ?>
                        <span class="pull-right"><?= $model->order ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Status') ?>
                        <span class="pull-right"><?= EhrHelper::getQywxUserStatusByIntValue($model->status) ?></span>
                    </a>
                </li>
                <li><a href="#"><?= Yii::t('app', 'Extattr') ?>
                        <span class="pull-right"><?= $model->extattr ?></span>
                    </a>
                </li>
            </ul>
        </div>
    </div>

</div>
